<!DOCTYPE html>
<html>
<head>
    <include file="./public/sty.html"/>
</head>
<body>
<script src="/style/js/qrcode.min.js"></script>
<div id="app" class="ebankPay">

    <include file="./public/header.html"/>

    <div class="container containerUser fix pt15" s="[object Object]">
        <div class="slideUser">
            <ul class="sildeSession"><h3><span></span>账号管理</h3>
                <li class=""><a href="{:U('Users/personalInfo')}">个人信息</a></li>
                <li class="curr"><a href="{:U('Users/securityCenter')}">安全中心</a></li>
                <li class=""><a href="{:U('Users/manageBankcard2')}">银行卡管理</a></li>
            </ul>
            <ul class="sildeSession"><h3><span></span>投注管理</h3>
                <li><a href="{:U('Users/BetRecord')}" class="">投注记录</a></li>
                <li><a href="{:U('Users/seekOrder')}" class="">追号记录</a></li>
            </ul>
            <ul class="sildeSession"><h3><span></span>资金管理</h3>
                <li><a href="{:U('Users/BillRecord')}" class="">交易记录</a></li>
                <li class=""><a href="{:U('Users/PLstatement')}">今日盈亏</a></li>
            </ul>
            <ul class="sildeSession">
                <h3><span></span>代理中心</h3>
                <li><a href="{:U('Users/agentIntro')}" class="">代理说明</a></li>
                <li class=""><a href="{:U('Users/agentReport')}">代理报表</a></li>
                <li><a href="{:U('Users/lowerReport')}" class="">下级报表</a></li>
                <li class=""><a href="{:U('Users/manageInvite')}">下级开户</a></li>
                <li><a href="{:U('Users/agentMember')}" class="">会员管理</a></li>
                <li><a href="{:U('Users/agentBetRecord')}" class="">投注明细</a></li>
                <li><a href="{:U('Users/agentBillRecord')}" class="">交易明细</a></li>
            </ul>
            <ul class="sildeSession"><h3><span></span>消息管理</h3>
                <li><a href="{:U('Users/letter')}" class="">站内信</a></li>
                <li><a href="{:U('Users/Notice')}" class="">网站公告</a></li>
            </ul>
        </div>
        <div data-v-6bb4bdc2="" class="userRight">
			<div data-v-6bb4bdc2="" class="userTitle mgb10">我要提现</div> 
			<div data-v-6bb4bdc2="" class="userMain mgb10">
				<ul data-v-6bb4bdc2="" class="submitContent mg30">
					<li data-v-6bb4bdc2="">
						<span data-v-6bb4bdc2="">账户余额：</span>
						<ins data-v-6bb4bdc2="">
							<div data-v-6bb4bdc2="" class="money"><?php echo sprintf('%.2f',$res['money']); ?></div>&nbsp;&nbsp;
						</ins>元
					</li> 
					<li data-v-6bb4bdc2="">
						<span data-v-6bb4bdc2="">可提现金额：</span>
						<ins data-v-6bb4bdc2="">
						<div data-v-6bb4bdc2="" class="money" id="kti">
							<?php if($cc==0){
							      echo "0.00";
						         }else{
						           echo sprintf('%.2f',$cc);
						         }
						  ?>

						</div>&nbsp;&nbsp;
						</ins>元
					</li> 
					<li data-v-6bb4bdc2="">
						<span data-v-6bb4bdc2="">今天剩余提现次数：</span>
						<ins data-v-6bb4bdc2="">
							<div data-v-6bb4bdc2="" class="money"><?php echo 5 - $co;?></div>&nbsp;&nbsp;
						</ins>次
					</li> 
					<li data-v-6bb4bdc2=""><span data-v-6bb4bdc2="">选择银行：</span>

                        <div data-v-6bb4bdc2="" class="selectBankCon">
                            <div data-v-6bb4bdc2="" id="selectBank" class="selectBank banked
                                  <if condition="$ban[0]['bankid'] eq 1 "> bankICBC
									 <elseif condition="$ban[0]['bankid'] eq 2"/>bankCCB
									 <elseif condition="$ban[0]['bankid'] eq 3"/>bankABC
									 <elseif condition="$ban[0]['bankid'] eq 4"/>bankCMBC
									 <elseif condition="$ban[0]['bankid'] eq 5"/>bankCMB
									 <elseif condition="$ban[0]['bankid'] eq 6"/>bankBCM
									 <elseif condition="$ban[0]['bankid'] eq 7"/>bankBOC
									 <elseif condition="$ban[0]['bankid'] eq 8"/>bankPSBC
									 <elseif condition="$ban[0]['bankid'] eq 9"/>bankCCB
									 <elseif condition="$ban[0]['bankid'] eq 10"/>bankCIB
									 <elseif condition="$ban[0]['bankid'] eq 11"/>bankHXBANK
									 <elseif condition="$ban[0]['bankid'] eq 12"/>bankSPDB
									 <elseif condition="$ban[0]['bankid'] eq 13"/>bankGDB
									 <elseif condition="$ban[0]['bankid'] eq 14"/>bankSPABANK
									 <elseif condition="$ban[0]['bankid'] eq 15"/>bankCEB
									 <else /> bankCRCC
									 </if>">
							<span data-v-6bb4bdc2="">请选择银行</span>
							<i data-v-6bb4bdc2=""></i>
                            <ins data-v-6bb4bdc2="">尾号：<?php echo substr($ban[0]['card'],-4);?></ins>
                        </div>
                        <ul data-v-6bb4bdc2="" class="bankList fix" style="display: none;">
                            	<foreach name="ban" item="vv" key="key">
                                <li data-v-6bb4bdc2="">
									<input data-v-6bb4bdc2="" name="bank" <?php if($key==0)echo "checked";?> type="radio" id="{$vv.id}">
                                    <em data-v-6bb4bdc2="" class="iconBank <if condition="$vv.bankid eq 1 "> bankICBC
									 <elseif condition="$vv.bankid eq 2"/>bankCCB
									 <elseif condition="$vv.bankid eq 3"/>bankABC
									 <elseif condition="$vv.bankid eq 4"/>bankCMBC
									 <elseif condition="$vv.bankid eq 5"/>bankCMB
									 <elseif condition="$vv.bankid eq 6"/>bankBCM
									 <elseif condition="$vv.bankid eq 7"/>bankBOC
									 <elseif condition="$vv.bankid eq 8"/>bankPSBC
									 <elseif condition="$vv.bankid eq 9"/>bankCCB
									 <elseif condition="$vv.bankid eq 10"/>bankCIB
									 <elseif condition="$vv.bankid eq 11"/>bankHXBANK
									 <elseif condition="$vv.bankid eq 12"/>bankSPDB
									 <elseif condition="$vv.bankid eq 13"/>bankGDB
									 <elseif condition="$vv.bankid eq 14"/>bankSPABANK
									 <elseif condition="$vv.bankid eq 15"/>bankCEB
									 <else /> bankCRCC
									 </if>" data-hang="<if condition="$vv.bankid eq 1 "> bankICBC
									 <elseif condition="$vv.bankid eq 2"/>bankCCB
									 <elseif condition="$vv.bankid eq 3"/>bankABC
									 <elseif condition="$vv.bankid eq 4"/>bankCMBC
									 <elseif condition="$vv.bankid eq 5"/>bankCMB
									 <elseif condition="$vv.bankid eq 6"/>bankBCM
									 <elseif condition="$vv.bankid eq 7"/>bankBOC
									 <elseif condition="$vv.bankid eq 8"/>bankPSBC
									 <elseif condition="$vv.bankid eq 9"/>bankCCB
									 <elseif condition="$vv.bankid eq 10"/>bankCIB
									 <elseif condition="$vv.bankid eq 11"/>bankHXBANK
									 <elseif condition="$vv.bankid eq 12"/>bankSPDB
									 <elseif condition="$vv.bankid eq 13"/>bankGDB
									 <elseif condition="$vv.bankid eq 14"/>bankSPABANK
									 <elseif condition="$vv.bankid eq 15"/>bankCEB
									 <else /> bankCRCC
									 </if>"></em>
                                    <ins data-v-6bb4bdc2="">开户人姓名：{$vv.uname}<br data-v-6bb4bdc2="">银行卡号：<span class="wei">{$vv.card}</span></ins>
                                </li>
                                </foreach>
                        </ul>
					</li>
					<li data-v-6bb4bdc2="">
						<span data-v-6bb4bdc2="">提现金额：</span> 
						<input data-v-6bb4bdc2="" tag="提现金额" placeholder="请输入您要提现的金额" type="text" class="userInput" id="ti_money"> 
						<span id="spans1"></span>
					</li> 
					<li data-v-6bb4bdc2="">
						<span data-v-6bb4bdc2="">安全密码：</span> 
						<input data-v-6bb4bdc2="" type="password" style="display: none;"> 
						<input data-v-6bb4bdc2="" tag="安全密码" placeholder="请输入您的安全密码" type="password" autocomplete="off" class="userInput" id="safep">
						<span id="spans2"></span>
					</li> 
					<li data-v-6bb4bdc2="">
						<span data-v-6bb4bdc2=""></span>
						<a href="javascript:;"  class="submitBtn" onclick="tix()">确定</a>
					</li>
				</ul> 
			<div data-v-6bb4bdc2="" class="userTip mg30">
				<p data-v-6bb4bdc2="">※ 温馨提示：
				<br data-v-6bb4bdc2="">
                     可提现金额 = （有效投注 >= 最后一次充值金额）+ 奖金 + 活动礼金<br data-v-6bb4bdc2="">
				</p>
			</div>
		</div>
	</div>
    </div>
    <include file="./public/footer.html"/>
</div>
<div id="tishi1" class="layermbox layermbox0 layermshow" index="11">
	<div class="laymshade"></div>
	<div class="layermmain">
		<div class="section">
			<div class="layermchild layerConfirm layermanim"><h3 style="">温馨提示</h3>
				<button class="layermend"></button>
				<div class="layermcont">·提交成功·</div>
				<div class="layermbtn"><span type="1">确定</span></div>
			</div>
		</div>
	</div>
</div>
<script src="/style/js/jquery.min.js"></script>
<script src="/style/js/fx.js"></script>
<script>
var num = '<?php echo 5 - $co;?>';
    $(function(){
    	if(num <=0){
    		$(".submitBtn").css("opacity","0.5");
//    		$(".submitBtn").removeAttr("onclick");
    	}
        personalInfo();
        $("#selectBank").click(function(){
            $(".bankList").toggle();
        })
        $(".bankList li").click(function(){
            $(this).find("input").prop("checked",true);
            var hang = $(this).find(".iconBank").data("hang");
            var str = $(this).find(".wei").text();
            var wei = str.substring(str.length-4);
            $("#selectBank ins").text("尾号："+wei);
            $("#selectBank").removeClass();
            $("#selectBank").addClass("selectBank banked");
            $("#selectBank").addClass(hang);

            $(".bankList").toggle();

        })
    })

    function tix(){
    	$(".bankList").find("input").each(function(){
			if($(this).is(":checked")){
				aid = $(this).attr("id");
			}
		})
    	var kti = $("#kti").html();
    	var ti_money = $("#ti_money").val();
    	var safep = $("#safep").val();
    	if($.trim(ti_money)==""){
    		$("#spans1").html("<font color='red'>提现金额不能为空</font>");
    		return false;
    	}
    	var reg = /^[0-9]+(.[0-9]+)?$/; //   ^[0-9]+(.[0-9]{2})?$  限制小数点
		if(!reg.test(ti_money)){
			$("#spans1").html("<font color='red'>金额格式不正确</font>");
			return false;
		} 
		if(parseInt(ti_money) < 20 || parseInt(ti_money) >500000){
			$("#spans1").html("<font color='red'>最低20最高500000</font>");
			return false;
		}
		if(parseInt(kti) < parseInt(ti_money)){
			$("#spans1").html("<font color='red'>最高可提现金额"+kti+"</font>");
			return false;
		}
		$("#spans1").html("");
		if($.trim(safep)==""){
    		$("#spans2").html("<font color='red'>安全密码不能为空</font>");
    		return false;
    	}
		$("#spans2").html("");
		
		$.ajax({
             type: "POST",
             url: "{:U('Index/tx_do')}",
             data: {ti_money:ti_money, aid:aid,safep:safep},
             dataType: "json",
             success: function(data){
                 if(data=='1'){
                 	$("#spans2").html("");
//                 	alert("提交成功!");
					 $("#tishi1").show();
                 	window.location.reload();
                 }else if(data=='2'){
                 	$("#spans2").html("<font color='red'>安全密码不正确</font>");
    				return false;
                 }
              }
         });
    }
</script>
</body>
</html>